if (GetLocale() == "zhCN") then
	BM_ACTION_BUTTON_TITLE = {"增益法术", "zengyifashu"};
	COOLDOWN_HELPER_ADJ_BUFF_SIZE = "调整Buff尺寸";

	COOLDOWN_HELPER_MYBUFF_SIZE = "玩家BUFF";
	COOLDOWN_HELPER_OTHERBUFF_SIZE = "其他BUFF";
	BUFFMASTER_SHOW_TIMELEFT = "显示增益魔法的详细秒数";
	BUFFMASTER_SHOW_PARTY_BUFF = "显示队伍成员的增益魔法";
	BUFFMASTER_SHOW_TARGET_BUFF = "显示目标的完整的增益魔法";

elseif (GetLocale() == "zhTW") then
	BM_ACTION_BUTTON_TITLE = {"增益法術", "zengyifashu"};
	COOLDOWN_HELPER_ADJ_BUFF_SIZE = "調整Buff尺寸";
	COOLDOWN_HELPER_MYBUFF_SIZE = "玩家BUFF";
	COOLDOWN_HELPER_OTHERBUFF_SIZE = "其他BUFF";
	BUFFMASTER_SHOW_TIMELEFT = "顯示增益魔法的剩餘時間";
	BUFFMASTER_SHOW_PARTY_BUFF = "顯示隊伍成員的增益魔法";
	BUFFMASTER_SHOW_TARGET_BUFF = "顯示目標的完整的增益魔法";
else
	BM_ACTION_BUTTON_TITLE = "Buff Adjustments";
	COOLDOWN_HELPER_ADJ_BUFF_SIZE = "Adjust Buff Size"
	COOLDOWN_HELPER_MYBUFF_SIZE = "My Buff Size";
	COOLDOWN_HELPER_OTHERBUFF_SIZE = "Other Buff Size";
		
	BUFFMASTER_SHOW_TIMELEFT = "Show time left of buff";
	BUFFMASTER_SHOW_PARTY_BUFF = "Show party members' buffs";
	BUFFMASTER_SHOW_TARGET_BUFF = "Show all buffs on target";
end

if (IsConfigurableAddOn("CooldownHelper") or IsConfigurableAddOn("BuffMaster")) then
	ModManagement_RegisterMod(
		"BuffMaster",
		"Interface\\Icons\\ability_hunter_displacement",
		BM_ACTION_BUTTON_TITLE,
		"",
		nil,
		nil,
		{[3]=true}

	);
end
if (IsConfigurableAddOn("CooldownHelper")) then
	ModManagement_RegisterCheckBox(
		"BuffMaster",
		COOLDOWN_HELPER_ADJ_BUFF_SIZE,
		nil,
		"AdjustBuffSize",
		0,
		function (arg)
			if (arg == 1) then
				if (BigFoot_LoadAddOn("CooldownHelper")) then
					BFCH_ToggleAdjustBuffSize(true);
				end
			else
				if (BigFoot_IsAddOnLoaded("CooldownHelper")) then
					BFCH_ToggleAdjustBuffSize(nil);				
				end
			end
		end,
		0
	);
	
	ModManagement_RegisterSpinBox(
		"BuffMaster",
		COOLDOWN_HELPER_MYBUFF_SIZE, 
		nil,
		"BFCH_MYBUFF_SIZE",
		"range",
		{23, 40, 1},
		23, 
		function(arg)
			if (BigFoot_IsAddOnLoaded("CooldownHelper")) then
				BFCH_AdjustMyBuffSize(arg)
			end
		end,
		1
	);
	ModManagement_RegisterSpinBox(
		"BuffMaster",
		COOLDOWN_HELPER_OTHERBUFF_SIZE, 
		nil,
		"BFCH_OTHERBUFF_SIZE",
		"range",
		{12, 20, 1},
		17, 
		function(arg)
			if (BigFoot_IsAddOnLoaded("CooldownHelper")) then
				BFCH_AdjustOtherBuffSize(arg)
			end
		end,
		1
	);
end

if (IsConfigurableAddOn("BuffMaster")) then
	ModManagement_RegisterCheckBox(
		"BuffMaster",
		BUFFMASTER_SHOW_TIMELEFT,	-- text
		nil,															-- tooltip
		"BuffMasterShowTimeLeft",								-- variable
		1,																-- default
		function (__arg)	
			if (__arg == 1) then
				if (not BigFoot_IsAddOnLoaded("BuffMaster")) then
					BigFoot_LoadAddOn("BuffMaster");
				end	
			end	
			if (BigFoot_IsAddOnLoaded("BuffMaster")) then									-- callback
				BuffMaster_ToggleTimeLeft(__arg)
			end
		end
	);

	ModManagement_RegisterCheckBox(
		"BuffMaster",
		BUFFMASTER_SHOW_PARTY_BUFF,
		nil,
		"EnablePartyBuffer",
		1,
		function (__arg)
			if (__arg == 1) then
				if (not BigFoot_IsAddOnLoaded("BuffMaster")) then
					BigFoot_LoadAddOn("BuffMaster");
				end	
			end	
			if (BigFoot_IsAddOnLoaded("BuffMaster")) then									-- callback
				BuffMaster_ToggleShowParty(__arg)
			end
		end
	);
end